home *** CD-ROM | disk | FTP | other *** search
- Path: isonews.bbn.hp.com!hpbblb!news
- From: Matthias Dittrich <matti>
- Newsgroups: comp.lang.c++
- Subject: Re: what does this code do?
- Date: 11 Apr 1996 15:36:03 GMT
- Organization: Hewlett-Packard Co.
- Message-ID: <4kj8t3$5m0@hpbblb.bbn.hp.com>
- References: <4k6u2v$i2c@newsbf02.news.aol.com> <3167217D.AC7@lex.infi.net>
- NNTP-Posting-Host: trabant.bbn.hp.com
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.1N (X11; I; HP-UX A.09.07 9000/712)
- X-URL: news:3167217D.AC7@lex.infi.net
-
- Scott Hightower <hightowr@lex.infi.net> wrote:
- >Mrdavc wrote:
- >>
- >> linePtrs[currentLine][lineLen[currentLine]] = (char) key;
- >>
- >> What does this code do? It looks like linePtrs is a multidimensional
- >> array but its not defined that way. is both linePtrs[currentLine] and
- >> lineLen[currentLine] set to (char) key??
- >>
- >> example from Teach yourself Turbo C++ 4.5 for Windows by Craig Arnush
- >> p,355
- >
- >Sorry, don't have the book avail to confirm this, but sounds like linePtrs
- >is an array of pointers to lines, which are themselves char[]. And
- >currentLine is an index into the array of pointers and another array of
- >lengths for each line. So if currentLine=1423, and lineLen[1423]=64,
- >key is cast to char and placed at index 64 of the char array pointed to
- >by linePtrs[1423]. And then probably lineLen[1423] is incremented.
- >
- I can't see the increment operator (except in C++ :-).
- But linePtrs may be declared as
- char* linePtrs[MAX_INDEX];
-
- Good luck,
- Matthias
-
-